<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Insert Task</title>
</head>
<body>
<h1>Insert Task</h1>
<hr>
<a href="{% url 'webserver:show' %}">返回列表页</a>
<form action="{% url 'webserver:update' obj.id %}" method="post" name="update-form">
    <table>
        <tr>
            <td>id</td>
            <td><input type="text" name="id" placeholder="填写标题" value="{{ obj.id }}" disabled></td>
        </tr>
        <tr>
            <td>title<red>*</red></td>
            <td><input type="text" name="title" placeholder="填写标题" value="{{ obj.title }}"></td>
        </tr>
        <tr>
            <td>应用包名<red>*</red></td>
            <td><input type="text" name="func" placeholder="填写应用包名" value="{{ obj.func }}"></td>
        </tr>
        <tr>
            <td>应用参数<red></red></td>
            <td><input type="text" name="args" placeholder="格式: k=v, k=v" value="{{ obj.args }}"></td>
        </tr>
        <tr>
            <td>优先级(1-10)<red></red></td>
            <td><input type="number" name="priority" value="{% if obj.priority %}{{ obj.priority }}{% else %}5{% endif %}"></td>
        </tr>
        <tr>
            <td>定时任务类型<red></red></td>
            <td><input type="text" name="cron_type" placeholder="cron|interval|date, 默认cron" value="{{ obj.cron_type }}"></td>
        </tr>
        <tr>
            <td>定时任务参数<red></red></td>
            <td><input type="text" name="cron_params" placeholder="查看说明" value="{{ obj.cron_params }}"></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit" value="提  交">
                <input type="reset" value="重  写">
            </td>
        </tr>
    </table>
</form>

{% if errors %}
    <h2>errors</h2>
    <ul>
    {% for error in errors %}
        <li><red>{{ error }}</red></li>
    {% endfor %}
    </ul>
{% endif %}


</body>
</html>